package com.yixun.qfbao.model.enums;

/**
 * 日期维度枚举
 */
public enum  DimensionEnum {

    DAY("1","天"),
    WEEK("2","周"),
    MONTH("3","月");

    private String code;

    private String desc;

    DimensionEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getDescByCode(int code) {
        for (DimensionEnum dimensionEnum : DimensionEnum.values()) {
            if(dimensionEnum.code.equals(code)) {
                return dimensionEnum.desc;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
